#include <stdio.h>
#include <math.h>
int main()
{
    int i, t, k, a[3];
    printf(" there are following armstrong number smaller than 1000:\n");
    for (i = 2; i < 1000; i++)
    {
        for (t = 0, k = 1000; k >= 10; t++)
        {
            a[t] = (i % k) / (k / 10);
            k /= 10;
        }
        if (a[0] * a[0] * a[0] + a[1] * a[1] * a[1] + a[2] * a[2] * a[2]==i)
            printf(" %d\n", i);
    }
}
